<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2018/5/30
 * Time: 11:33
 */

namespace app\model;


class Video extends Model
{
    public function __construct($db)
    {
        parent::__construct($db,"video");
    }


    /*=============================cron使用=====================*/
    public function getReadyHandleVideoMusic($limit)
    {
        $this->db->select("a.id,a.ori_video_url,a.no_audio_video_url,a.transcode_video_url,a.transcode_no_audio_video_url,a.ori_music_url,a.cut_music_url,a.time_length as video_time,b.time_length as audio_length");
        $this->db->from("video as a");
        $this->db->join("music as b","a.music_id=b.id");
        $this->db->where(["a.transcode_status!="=>1,"a.transcode_count<="=>10,"a.type"=>2,"a.status!="=>-1]);
        $this->db->limit($limit);
        $query = $this->db->get();
        return $query->all();
    }

}